import React from 'react'
import {Outlet,useNavigate} from 'react-router-dom'
export default function Home() {

    //需要创建一个navigate
    const navigate = useNavigate()
    const getThirdmusic =()=>{
        navigate('/main/home/music/0429?user=yin&age=18',{
            state:[
                { id: "001", name: "最伟大的作品" },
                { id: "002", name: "夜曲" },
                { id: "003", name: "爷爷泡的茶" },
                { id: "004", name: "求佛" },
                { id: "005", name: "白狐" }
            ]
        })
    }
    const getThirdnews =()=>{
        navigate('/main/home/news/0429?user=yin&age=18',{
            state:[
                { id: "001", name: "中国人" },
                { id: "002", name: "白狐" },
                { id: "003", name: "求佛" },
                { id: "004", name: "爷爷泡的茶" },
                { id: "005", name: "夜曲" }
            ]
        })
    }

  return (


    <div>
        <h1>我是Home</h1>
        <button onClick={getThirdmusic}>Music</button>
        <button onClick={getThirdnews}>News</button>
        <Outlet/>
    </div>
  )
}
